﻿@model AllAgreed.DataLayer.Models.User[]
@{
    ViewBag.Title = "Пользователи";
}
@section Menu
{
    @Html.Partial("_menu")
}
<div class="center-top">
    <form id="form" class="form-search" action="@Url.Action("Search", "User")">
        <div class="input-append">
            <input name="query" type="text" class="span2 search-query" placeholder="Введите текст поиска..">
            <button type="submit" class="btn">Найти</button>
        </div>
    </form>
    <h2 class="lead">Пользователи системы:</h2>
    @if (Model != null && Model.Length>0)
    {
        foreach (var user in Model)
        {
            <a href="@Url.Action("Profile", "User", new {id = @user.UserId})">
                <div class="user-info">
                    <div class="pull-left">
                        @{ var urlAvatar = @user.Avatar ?? @Url.Content("~/Images/defaultUserAvatar.png"); }
                        <img class="users-image-profile" src="@urlAvatar" alt="аватарка"/>
                    </div>
                    <div class="pull-left">
                        <p>@user.Login</p>
                        <p>@user.LastName</p>
                        <p>@user.Name</p>
                    </div>
                </div>
            </a>
        }
    }
    else
    {
        <div>
            Ничего не нашлось, попробуйте снова.
        </div>
    }

</div>
